home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1534 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.8 KB  |  67 lines

  1. Newsgroups: comp.lang.c++
  2. Path: ERA.COM!era!spencer
  3. From: spencer@ERA.COM (Spencer Allain)
  4. Subject: Re: type checking in C++ was Re: Hungarian notation
  5. In-Reply-To: Peter Juhl's message of 11 Jan 1996 07: 22:02 GMT
  6. Message-ID: <SPENCER.96Jan11103334@zorgon.ERA.COM>
  7. Sender: news@ERA.COM
  8. Organization: Engineering Research Associates, Vienna, VA
  9. References: <4cf8hf$8fe@hopi.gate.net> <DKoBrn.CHs@falcon.daytonoh.attgis.com>
  10.     <4d1j37$ge8@stc06.ctd.ornl.gov> <4d2dqq$4lq@news.uni-c.dk>
  11. Date: Thu, 11 Jan 1996 15:33:34 GMT
  12.  
  13. In article <4d2dqq$4lq@news.uni-c.dk> Peter Juhl <etiaseti@inet.uni-c.dk> writes:
  14.  
  15.    mbk@jt3ws1.etd.ornl.gov (Kennel) wrote:
  16.    >
  17.    >At one point something like this could be a problem.  It it still?
  18.    >
  19.    >function(Type *p) {
  20.    >
  21.    >// One of this may silently crash or do bad things.  Both typecheck. 
  22.    >
  23.    >//    delete p;
  24.    >//    delete [] p; 
  25.    >
  26.    >}
  27.    >
  28.  
  29.    This has not been a problem for years, delete p , is the way 
  30.    things work.
  31.  
  32.    --- peter
  33.  
  34.    Peter Juhl         etiaseti@inet.uni-c.dk
  35.  
  36.  
  37. <* SARCASM ON *>
  38.  
  39. Great!!!!  I'm so pleased that this hasn't been a problem for years.
  40. To think that I was worried about trivial things like:
  41.  
  42.    Type* type_ptr = new Type[10] ;
  43.  
  44.    function(type_ptr) ;
  45.  
  46. where function is:
  47.  
  48.    function(Type* p)
  49.    {
  50.      delete p ;
  51.    }
  52.  
  53. <* SARCASM OFF *>
  54.  
  55.  
  56. -Spencer
  57.  
  58. ----------------------------------------------------------------------
  59. Spencer Allain                    E-mail:  spencer@era.com
  60. Engineering Research Associates   Phone :  (703) 734-8800 x1414
  61. 1595 Spring Hill Road             Fax   :  (703) 827-9411
  62. Vienna, VA  22182-2235
  63.  
  64. Modula-3  FAQ                     http://www.vlsi.polymtl.ca/m3/
  65. <A HREF=http://www.vlsi.polymtl.ca/m3/>Modula-3 FAQ, etc. </A>
  66. ----------------------------------------------------------------------
  67.